//时间格式化
function timeStamp2String(time){
		if(time == null)return "";
	    var datetime = new Date();
	    datetime.setTime(time);
	    var year = datetime.getFullYear();
	    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
	    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
	    var hour = datetime.getHours()< 10 ? "0" + datetime.getHours() : datetime.getHours();
	    var minute = datetime.getMinutes()< 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
	    var second = datetime.getSeconds()< 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
	    return year + "-" + month + "-" + date+" "+hour+":"+minute+":"+second;
}

function modeShow(status){
	//alert(status);
	if(status == 1){
		return "无故障";
	}else if(status == 2 || status == 0){
		return "维护中";
	}else{
		return "有故障";
	}
}

function lockStatusShow(status){
	//alert(status);
	if(status == 1){
		return "关";
	}else if(status == 2){
		return "开";
	}else if(status == 0){
		return "关";
	}
}

function chargeStatusShow(status){
	//alert(status);
	if(status == 1){
		return "充电中";
	}else if(status == 2){
		return "未充电";
	}else if(status == 0){
		return "未充电";
	}else{
		return "未知";
	}
}

function vBusShow(charge,status){
	if(charge == 1){
		return status;
	}else{
		return 0;
	}
}

function replyShow(reply){
	//alert(reply);
	if(reply == 1){
		return "已处理";
	}else if(reply == 2){
		return "<span class='tips'>处理失败</span>";
	}else{
		return "未知";
	}
}

function undefinedShow(status){
	if(status == undefined){
		return "-";
	
	}else{
		return status;
	}
}

function batteryShow(status){
	if(status == undefined){
		return "";
	
	}else{
		if(status >15)
		return status;
		else
			return "<span class='tips'>"+status+"</span>";
	}
}

function alertPopu(id,msg){
	$("#"+id).css("alert alert-warning alert-dismissible");
	$("#"+id).attr("role","alert");
	$("#"+id).html("<span class='tips' >* "+msg+"</span> ");
}

function alertSuccessPopu(id,msg){
	$("#"+id).css("alert alert-success");
	$("#"+id).attr("role","alert");
	$("#"+id).html("<span>* "+msg+"</span> ");
}

function showBox(msg){
	alert(msg);
}
